home *** CD-ROM | disk | FTP | other *** search
/ Pesquisa Dirigida / Pesquisa Dirigida.iso / JOGOS / mini_putt2.swf / scripts / DefineSprite_196 / frame_1 / DoAction.as
Text File  |  2005-01-07  |  1KB  |  55 lines

  1. tellTarget("..")
  2. {
  3.    xdir = (ball._x - putter._x) * 0.33;
  4.    ydir = (ball._y - putter._y) * 0.33;
  5.    node1._x = ball._x + xdir * 4.5;
  6.    node1._y = ball._y + ydir * 4.5;
  7.    node2._x = ball._x + xdir * 2.75;
  8.    node2._y = ball._y + ydir * 2.75;
  9.    node3._x = ball._x + xdir * 1.5;
  10.    node3._y = ball._y + ydir * 1.5;
  11.    node4._x = ball._x + xdir * 0.5;
  12.    node4._y = ball._y + ydir * 0.5;
  13. }
  14. set("../:speed",eval("../:xdir") * eval("../:xdir") + eval("../:ydir") * eval("../:ydir"));
  15. if(775 < eval("../:speed"))
  16. {
  17.    tellTarget("../node1")
  18.    {
  19.       gotoAndStop(2);
  20.    }
  21.    tellTarget("../node2")
  22.    {
  23.       gotoAndStop(2);
  24.    }
  25.    tellTarget("../node3")
  26.    {
  27.       gotoAndStop(2);
  28.    }
  29.    tellTarget("../node4")
  30.    {
  31.       gotoAndStop(2);
  32.    }
  33. }
  34. else
  35. {
  36.    tellTarget("../node1")
  37.    {
  38.       gotoAndStop(1);
  39.    }
  40.    tellTarget("../node2")
  41.    {
  42.       gotoAndStop(1);
  43.    }
  44.    tellTarget("../node3")
  45.    {
  46.       gotoAndStop(1);
  47.    }
  48.    tellTarget("../node4")
  49.    {
  50.       gotoAndStop(1);
  51.    }
  52. }
  53. eval("../:putt")._x = eval("../:putter")._x;
  54. eval("../:putt")._y = eval("../:putter")._y;
  55.